import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooLinkController } from '../../../controllers';
const uctoolinkRouter = new Router();
const linkController = new uctooLinkController();

uctoolinkRouter.post('/add', requireUser, linkController.add);
uctoolinkRouter.post('/edit', requireUser, rowLevelPermission('uctoo/link'), linkController.edit);
uctoolinkRouter.post('/del', requireUser, rowLevelPermission('uctoo/link'), linkController.delete);

//For getting link with permission control
uctoolinkRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/link'), linkController.getSingle);
uctoolinkRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/link'), linkController.getMany);
uctoolinkRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/link'), linkController.getMany);

//#endregion AutoCreateCode
export default uctoolinkRouter;
